#include "Car.h"
#include"State.h"
#include<iostream>
using namespace std;
Car::Car(State *pState)
{
	m_pState = pState;
}


Car::~Car(void)
{
	delete m_pState;
}

void Car::SetState(State *pState)
{
	if (0 != pState)
	{
		delete m_pState;
		m_pState = 0;
	}
	this->m_pState = pState;	
	cout<<"Current State is "<<*pState<<endl;
}

void Car::Pull()
{
	m_pState->ChangeState(this);
}
